const mongoose = require('mongoose');

const TaskSchema = new mongoose.Schema(
  {
    name: { type: String, required: true },
    style: { type: String, required: true },
    stylename: { type: String },
    user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
    product: { type: String },
    progress: { type: Number, default: 0},
    like: { type: Number, default: 0},
    pass: { type: Boolean , default: false },
  },
  { timestamps: true }
)

TaskSchema.methods.toString = function () {
  return this.name
}

mongoose.model('Task', TaskSchema)
